package graph;


public class MiniIntervals {


	
	
	public static double getMiniInterval(boolean largeCap, double rate){
		if(largeCap) {
			return getLargeInterval(rate);
		}
		return getSmallInterval(rate);
	}
	private static double getLargeInterval(double rate) {
		if(rate <= 0.49999) {
			return 0.0001;
		} else if (rate <= 0.9995) {
			return 0.0005;
		} else if (rate <= 4.999) {
			return 0.001;
		} else if (rate <= 9.995) {
			return 0.005;
		} else if (rate <= 49.99) {
			return 0.01;
		} else if (rate <= 99.95) {
			
			return 0.05;
		} else if (rate <= 499.90) {
			return 0.1;
		} else if (rate <= 999.50) {
			return 0.5;
		} else if (rate <= 4999) {
			return 1;
		} else if (rate <= 9995) {
			return 5;
		} else {
			return 10;
		}
		
	}
	private static double getSmallInterval(double rate) {
		if(rate <= 4.99) {
			return 0.01;
		} else if (rate <= 14.95) {
			return 0.05;
		} else if (rate <= 49.90) {
			return 0.10;
		} else if (rate <= 149.75) {
			return 0.25;
		} else if (rate <= 499.50) {
			return 0.50;
		} else if (rate <= 4999) {
			return 1;
		} else {
			return 5;
		}
		
	}
}



